home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / SpeechRecognition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  21.3 KB  |  508 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        SpeechRecognition.h
  3.  
  4.      Contains:    Apple Speech Recognition Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    PlainTalk 1.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __SPEECHRECOGNITION__
  18. #define __SPEECHRECOGNITION__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __MIXEDMODE__
  24. #include <MixedMode.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=mac68k
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49. /* Error Codes [Speech recognition gets -5100 through -5199] */
  50.  
  51. enum {
  52.     kSRNotAvailable                = -5100,                        /* the service requested is not avail or applicable */
  53.     kSRInternalError            = -5101,                        /* a system internal or hardware error condition */
  54.     kSRComponentNotFound        = -5102,                        /* a needed system resource was not located */
  55.     kSROutOfMemory                = -5103,                        /* an out of memory error occurred in the toolbox memory space */
  56.     kSRNotASpeechObject            = -5104,                        /* the object specified is no longer or never was valid */
  57.     kSRBadParameter                = -5105,                        /* an invalid parameter was specified */
  58.     kSRParamOutOfRange            = -5106,                        /* when we say 0-100, don't pass in 101. */
  59.     kSRBadSelector                = -5107,                        /* an unrecognized selector was specified */
  60.     kSRBufferTooSmall            = -5108,                        /* returned from attribute access functions */
  61.     kSRNotARecSystem            = -5109,                        /* the object used was not a SRRecognitionSystem */
  62.     kSRFeedbackNotAvail            = -5110,                        /* there is no feedback window associated with SRRecognizer */
  63.     kSRCantSetProperty            = -5111,                        /* a non-settable property was specified */
  64.     kSRCantGetProperty            = -5112,                        /* a non-gettable property was specified */
  65.     kSRCantSetDuringRecognition    = -5113,                        /* the property can't be set while recognition is in progress -- do before or between utterances. */
  66.     kSRAlreadyListening            = -5114,                        /* in response to SRStartListening */
  67.     kSRNotListeningState        = -5115,                        /* in response to SRStopListening */
  68.     kSRModelMismatch            = -5116,                        /* no acoustical models are avail to match request */
  69.     kSRNoClientLanguageModel    = -5117,                        /* trying to access a non-specified SRLanguageModel */
  70.     kSRNoPendingUtterances        = -5118,                        /* nothing to continue search on */
  71.     kSRRecognitionCanceled        = -5119,                        /* an abort error occurred during search */
  72.     kSRRecognitionDone            = -5120,                        /* search has finished, but nothing was recognized */
  73.     kSROtherRecAlreadyModal        = -5121,                        /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
  74.     kSRHasNoSubItems            = -5122,                        /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
  75.     kSRSubItemNotFound            = -5123,                        /* returned when accessing a non-existent sub item of a container */
  76.     kSRLanguageModelTooBig        = -5124,                        /* Cant build language models so big */
  77.     kSRAlreadyReleased            = -5125,                        /* this object has already been released before */
  78.     kSRAlreadyFinished            = -5126,                        /* the language model can't be finished twice */
  79.     kSRWordNotFound                = -5127,                        /* the spelling couldn't be found in lookup(s) */
  80.     kSRNotFinishedWithRejection    = -5128,                        /* property not found because the LMObj is not finished with rejection */
  81.     kSRExpansionTooDeep            = -5129,                        /* Language model is left recursive or is embedded too many levels */
  82.     kSRTooManyElements            = -5130,                        /* Too many elements added to phrase or path or other langauge model object */
  83.     kSRCantAdd                    = -5131,                        /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    */
  84.     kSRSndInSourceDisconnected    = -5132,                        /* Sound input source is disconnected */
  85.     kSRCantReadLanguageObject    = -5133,                        /* An error while trying to create new Language object from file or pointer -- possibly bad format */
  86.                                                                 /* non-release debugging error codes are included here */
  87.     kSRNotImplementedYet        = -5199                            /* you'd better wait for this feature in a future release */
  88. };
  89.  
  90.  
  91. /* Type Definitions */
  92. typedef struct OpaqueSRSpeechObject*     SRSpeechObject;
  93. typedef SRSpeechObject                     SRRecognitionSystem;
  94. typedef SRSpeechObject                     SRRecognizer;
  95. typedef SRSpeechObject                     SRSpeechSource;
  96. typedef SRSpeechSource                     SRRecognitionResult;
  97. typedef SRSpeechObject                     SRLanguageObject;
  98. typedef SRLanguageObject                 SRLanguageModel;
  99. typedef SRLanguageObject                 SRPath;
  100. typedef SRLanguageObject                 SRPhrase;
  101. typedef SRLanguageObject                 SRWord;
  102. /* between 0 and 100 */
  103. typedef unsigned short                     SRSpeedSetting;
  104. /* between 0 and 100 */
  105. typedef unsigned short                     SRRejectionLevel;
  106. /* When an event occurs, the user supplied proc will be called with a pointer    */
  107. /*    to the param passed in and a flag to indicate conditions such                */
  108. /*    as interrupt time or system background time.                                */
  109.  
  110. struct SRCallBackStruct {
  111.     long                             what;                        /* one of notification flags */
  112.     long                             message;                    /* contains SRRecognitionResult id */
  113.     SRRecognizer                     instance;                    /* ID of recognizer being notified */
  114.     OSErr                             status;                        /* result status of last search */
  115.     short                             flags;                        /* non-zero if occurs during interrupt */
  116.     long                             refCon;                        /* user defined - set from SRCallBackParam */
  117. };
  118. typedef struct SRCallBackStruct            SRCallBackStruct;
  119. /* Call back procedure definition */
  120. typedef CALLBACK_API( void , SRCallBackProcPtr )(SRCallBackStruct *param);
  121. typedef STACK_UPP_TYPE(SRCallBackProcPtr)                         SRCallBackUPP;
  122. enum { uppSRCallBackProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  123. #define NewSRCallBackProc(userRoutine)                             (SRCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSRCallBackProcInfo, GetCurrentArchitecture())
  124. #define CallSRCallBackProc(userRoutine, param)                     CALL_ONE_PARAMETER_UPP((userRoutine), uppSRCallBackProcInfo, (param))
  125.  
  126. struct SRCallBackParam {
  127.     SRCallBackUPP                     callBack;
  128.     long                             refCon;
  129. };
  130. typedef struct SRCallBackParam            SRCallBackParam;
  131. /* Recognition System Types */
  132.  
  133. enum {
  134.     kSRDefaultRecognitionSystemID = 0
  135. };
  136.  
  137. /* Recognition System Properties */
  138.  
  139. enum {
  140.     kSRFeedbackAndListeningModes = FOUR_CHAR_CODE('fbwn'),        /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
  141.     kSRRejectedWord                = FOUR_CHAR_CODE('rejq'),        /* the SRWord used to represent a rejection */
  142.     kSRCleanupOnClientExit        = FOUR_CHAR_CODE('clup')        /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
  143. };
  144.  
  145.  
  146. enum {
  147.     kSRNoFeedbackNoListenModes    = 0,                            /* next allocated recognizer has no feedback window and doesn't use listening modes    */
  148.     kSRHasFeedbackHasListenModes = 1,                            /* next allocated recognizer has feedback window and uses listening modes             */
  149.     kSRNoFeedbackHasListenModes    = 2                                /* next allocated recognizer has no feedback window but does use listening modes     */
  150. };
  151.  
  152. /* Speech Source Types */
  153.  
  154. enum {
  155.     kSRDefaultSpeechSource        = 0,
  156.     kSRLiveDesktopSpeechSource    = FOUR_CHAR_CODE('dklv'),        /* live desktop sound input */
  157.     kSRCanned22kHzSpeechSource    = FOUR_CHAR_CODE('ca22')        /* AIFF file based 16 bit, 22.050 KHz sound input */
  158. };
  159.  
  160. /* Notification via Apple Event or Callback */
  161. /* Notification Flags */
  162.  
  163. enum {
  164.     kSRNotifyRecognitionBeginning = 1L << 0,                    /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
  165.     kSRNotifyRecognitionDone    = 1L << 1                        /* recognition has terminated. result (if any) is available. */
  166. };
  167.  
  168. /* Apple Event selectors */
  169. /* AppleEvent message class  */
  170.  
  171. enum {
  172.     kAESpeechSuite                = FOUR_CHAR_CODE('sprc')
  173. };
  174.  
  175. /* AppleEvent message event ids */
  176.  
  177. enum {
  178.     kAESpeechDone                = FOUR_CHAR_CODE('srsd'),
  179.     kAESpeechDetected            = FOUR_CHAR_CODE('srbd')
  180. };
  181.  
  182. /* AppleEvent Parameter ids */
  183.  
  184. enum {
  185.     keySRRecognizer                = FOUR_CHAR_CODE('krec'),
  186.     keySRSpeechResult            = FOUR_CHAR_CODE('kspr'),
  187.     keySRSpeechStatus            = FOUR_CHAR_CODE('ksst')
  188. };
  189.  
  190. /* AppleEvent Parameter types */
  191.  
  192. enum {
  193.     typeSRRecognizer            = FOUR_CHAR_CODE('trec'),
  194.     typeSRSpeechResult            = FOUR_CHAR_CODE('tspr')
  195. };
  196.  
  197.  
  198. /* SRRecognizer Properties */
  199.  
  200. enum {
  201.     kSRNotificationParam        = FOUR_CHAR_CODE('noti'),        /* see notification flags below */
  202.     kSRCallBackParam            = FOUR_CHAR_CODE('call'),        /* type SRCallBackParam */
  203.     kSRSearchStatusParam        = FOUR_CHAR_CODE('stat'),        /* see status flags below */
  204.     kSRAutoFinishingParam        = FOUR_CHAR_CODE('afin'),        /* automatic finishing applied on LM for search */
  205.     kSRForegroundOnly            = FOUR_CHAR_CODE('fgon'),        /* Boolean. Default is true. If true, client recognizer only active when in foreground.    */
  206.     kSRBlockBackground            = FOUR_CHAR_CODE('blbg'),        /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    */
  207.     kSRBlockModally                = FOUR_CHAR_CODE('blmd'),        /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
  208.     kSRWantsResultTextDrawn        = FOUR_CHAR_CODE('txfb'),        /* Boolean. Default is true. If true, search results are posted to Feedback window */
  209.     kSRWantsAutoFBGestures        = FOUR_CHAR_CODE('dfbr'),        /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
  210.     kSRSoundInVolume            = FOUR_CHAR_CODE('volu'),        /* short in [0..100] log scaled sound input power. Can't set this property */
  211.     kSRReadAudioFSSpec            = FOUR_CHAR_CODE('aurd'),        /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
  212.     kSRCancelOnSoundOut            = FOUR_CHAR_CODE('caso'),        /* Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. */
  213.     kSRSpeedVsAccuracyParam        = FOUR_CHAR_CODE('sped')        /* SRSpeedSetting between 0 and 100 */
  214. };
  215.  
  216. /* 0 means more accurate but slower. */
  217. /* 100 means (much) less accurate but faster. */
  218.  
  219. enum {
  220.     kSRUseToggleListen            = 0,                            /* listen key modes */
  221.     kSRUsePushToTalk            = 1
  222. };
  223.  
  224.  
  225. enum {
  226.     kSRListenKeyMode            = FOUR_CHAR_CODE('lkmd'),        /* short: either kSRUseToggleListen or kSRUsePushToTalk */
  227.     kSRListenKeyCombo            = FOUR_CHAR_CODE('lkey'),        /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */
  228.     kSRListenKeyName            = FOUR_CHAR_CODE('lnam'),        /* Str63: string representing ListenKeyCombo */
  229.     kSRKeyWord                    = FOUR_CHAR_CODE('kwrd'),        /* Str255: keyword preceding spoken commands in kSRUseToggleListen mode */
  230.     kSRKeyExpected                = FOUR_CHAR_CODE('kexp')        /* Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? */
  231. };
  232.  
  233. /* Operational Status Flags */
  234.  
  235. enum {
  236.     kSRIdleRecognizer            = 1L << 0,                        /* engine is not active */
  237.     kSRSearchInProgress            = 1L << 1,                        /* search is in progress */
  238.     kSRSearchWaitForAllClients    = 1L << 2,                        /* search is suspended waiting on all clients' input */
  239.     kSRMustCancelSearch            = 1L << 3,                        /* something has occurred (sound played, non-speech detected) requiring the search to abort */
  240.     kSRPendingSearch            = 1L << 4                        /* we're about to start searching */
  241. };
  242.  
  243. /* Recognition Result Properties */
  244.  
  245. enum {
  246.     kSRTEXTFormat                = FOUR_CHAR_CODE('TEXT'),        /* raw text in user supplied memory */
  247.     kSRPhraseFormat                = FOUR_CHAR_CODE('lmph'),        /* SRPhrase containing result words */
  248.     kSRPathFormat                = FOUR_CHAR_CODE('lmpt'),        /* SRPath containing result phrases or words */
  249.     kSRLanguageModelFormat        = FOUR_CHAR_CODE('lmfm')        /* top level SRLanguageModel for post parse */
  250. };
  251.  
  252. /* SRLanguageObject Family Properties */
  253.  
  254. enum {
  255.     kSRSpelling                    = FOUR_CHAR_CODE('spel'),        /* spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel */
  256.     kSRLMObjType                = FOUR_CHAR_CODE('lmtp'),        /* Returns one of SRLanguageObject Types listed below */
  257.     kSRRefCon                    = FOUR_CHAR_CODE('refc'),        /* 4 bytes of user storage */
  258.     kSROptional                    = FOUR_CHAR_CODE('optl'),        /* Boolean -- true if SRLanguageObject is optional    */
  259.     kSREnabled                    = FOUR_CHAR_CODE('enbl'),        /* Boolean -- true if SRLanguageObject enabled */
  260.     kSRRepeatable                = FOUR_CHAR_CODE('rptb'),        /* Boolean -- true if SRLanguageObject is repeatable */
  261.     kSRRejectable                = FOUR_CHAR_CODE('rjbl'),        /* Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord */
  262.                                                                 /*        object can be returned in place of SRLanguageObject with this property)    */
  263.     kSRRejectionLevel            = FOUR_CHAR_CODE('rjct')        /* SRRejectionLevel between 0 and 100 */
  264. };
  265.  
  266. /* LM Object Types -- returned as kSRLMObjType property of language model objects */
  267.  
  268. enum {
  269.     kSRLanguageModelType        = FOUR_CHAR_CODE('lmob'),        /* SRLanguageModel */
  270.     kSRPathType                    = FOUR_CHAR_CODE('path'),        /* SRPath */
  271.     kSRPhraseType                = FOUR_CHAR_CODE('phra'),        /* SRPhrase */
  272.     kSRWordType                    = FOUR_CHAR_CODE('word')        /* SRWord */
  273. };
  274.  
  275. /* a normal and reasonable rejection level */
  276.  
  277. enum {
  278.     kSRDefaultRejectionLevel    = 50
  279. };
  280.  
  281. /********************************************************************************/
  282. /*                        NOTES ON USING THE API                                    */
  283. /*                                                                                */
  284. /*        All operations (with the exception of SRGetRecognitionSystem) are        */
  285. /*        directed toward an object allocated or begot from New, Get and Read        */
  286. /*        type calls.                                                                */
  287. /*                                                                                */
  288. /*        There is a simple rule in dealing with allocation and disposal:            */
  289. /*                                                                                */
  290. /*        *    all toolbox allocations are obtained from a SRRecognitionSystem        */
  291. /*                                                                                */
  292. /*        *    if you obtain an object via New or Get, then you own a reference     */
  293. /*            to that object and it must be released via SRReleaseObject when        */
  294. /*            you no longer need it                                                */
  295. /*                                                                                */
  296. /*        *    when you receive a SRRecognitionResult object via AppleEvent or        */
  297. /*            callback, it has essentially been created on your behalf and so        */
  298. /*            you are responsible for releasing it as above                        */
  299. /*                                                                                */
  300. /*        *    when you close a SRRecognitionSystem, all remaining objects which        */
  301. /*            were allocated with it will be forcefully released and any            */
  302. /*            remaining references to those objects will be invalid.                */
  303. /*                                                                                */
  304. /*        This translates into a very simple guideline:                            */
  305. /*            If you allocate it or have it allocated for you, you must release    */
  306. /*            it.  If you are only peeking at it, then don't release it.            */
  307. /*                                                                                */
  308. /********************************************************************************/
  309. /* Opening and Closing of the SRRecognitionSystem */
  310. EXTERN_API( OSErr )
  311. SROpenRecognitionSystem            (SRRecognitionSystem *    system,
  312.                                  OSType                 systemID)                            THREEWORDINLINE(0x303C, 0x0400, 0xAA56);
  313.  
  314. EXTERN_API( OSErr )
  315. SRCloseRecognitionSystem        (SRRecognitionSystem     system)                                THREEWORDINLINE(0x303C, 0x0201, 0xAA56);
  316.  
  317. /* Accessing Properties of any Speech Object */
  318. EXTERN_API( OSErr )
  319. SRSetProperty                    (SRSpeechObject         srObject,
  320.                                  OSType                 selector,
  321.                                  const void *            property,
  322.                                  Size                     propertyLen)                        THREEWORDINLINE(0x303C, 0x0802, 0xAA56);
  323.  
  324. EXTERN_API( OSErr )
  325. SRGetProperty                    (SRSpeechObject         srObject,
  326.                                  OSType                 selector,
  327.                                  void *                    property,
  328.                                  Size *                    propertyLen)                        THREEWORDINLINE(0x303C, 0x0803, 0xAA56);
  329.  
  330. /* Any object obtained via New or Get type calls must be released */
  331. EXTERN_API( OSErr )
  332. SRReleaseObject                    (SRSpeechObject         srObject)                            THREEWORDINLINE(0x303C, 0x0204, 0xAA56);
  333.  
  334. EXTERN_API( OSErr )
  335. SRGetReference                    (SRSpeechObject         srObject,
  336.                                  SRSpeechObject *        newObjectRef)                        THREEWORDINLINE(0x303C, 0x0425, 0xAA56);
  337.  
  338. /* SRRecognizer Instance Functions */
  339. EXTERN_API( OSErr )
  340. SRNewRecognizer                    (SRRecognitionSystem     system,
  341.                                  SRRecognizer *            recognizer,
  342.                                  OSType                 sourceID)                            THREEWORDINLINE(0x303C, 0x060A, 0xAA56);
  343.  
  344. EXTERN_API( OSErr )
  345. SRStartListening                (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x020C, 0xAA56);
  346.  
  347. EXTERN_API( OSErr )
  348. SRStopListening                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x020D, 0xAA56);
  349.  
  350. EXTERN_API( OSErr )
  351. SRSetLanguageModel                (SRRecognizer             recognizer,
  352.                                  SRLanguageModel         languageModel)                        THREEWORDINLINE(0x303C, 0x040E, 0xAA56);
  353.  
  354. EXTERN_API( OSErr )
  355. SRGetLanguageModel                (SRRecognizer             recognizer,
  356.                                  SRLanguageModel *        languageModel)                        THREEWORDINLINE(0x303C, 0x040F, 0xAA56);
  357.  
  358. EXTERN_API( OSErr )
  359. SRContinueRecognition            (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0210, 0xAA56);
  360.  
  361. EXTERN_API( OSErr )
  362. SRCancelRecognition                (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0211, 0xAA56);
  363.  
  364. EXTERN_API( OSErr )
  365. SRIdle                            (void)                                                        THREEWORDINLINE(0x303C, 0x0028, 0xAA56);
  366.  
  367. /* Language Model Building and Manipulation Functions */
  368. EXTERN_API( OSErr )
  369. SRNewLanguageModel                (SRRecognitionSystem     system,
  370.                                  SRLanguageModel *        model,
  371.                                  const void *            name,
  372.                                  Size                     nameLength)                            THREEWORDINLINE(0x303C, 0x0812, 0xAA56);
  373.  
  374. EXTERN_API( OSErr )
  375. SRNewPath                        (SRRecognitionSystem     system,
  376.                                  SRPath *                path)                                THREEWORDINLINE(0x303C, 0x0413, 0xAA56);
  377.  
  378. EXTERN_API( OSErr )
  379. SRNewPhrase                        (SRRecognitionSystem     system,
  380.                                  SRPhrase *                phrase,
  381.                                  const void *            text,
  382.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0814, 0xAA56);
  383.  
  384. EXTERN_API( OSErr )
  385. SRNewWord                        (SRRecognitionSystem     system,
  386.                                  SRWord *                word,
  387.                                  const void *            text,
  388.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0815, 0xAA56);
  389.  
  390. /* Operations on any object of the SRLanguageObject family */
  391. EXTERN_API( OSErr )
  392. SRPutLanguageObjectIntoHandle    (SRLanguageObject         languageObject,
  393.                                  Handle                 lobjHandle)                            THREEWORDINLINE(0x303C, 0x0416, 0xAA56);
  394.  
  395. EXTERN_API( OSErr )
  396. SRPutLanguageObjectIntoDataFile    (SRLanguageObject         languageObject,
  397.                                  short                     fRefNum)                            THREEWORDINLINE(0x303C, 0x0328, 0xAA56);
  398.  
  399. EXTERN_API( OSErr )
  400. SRNewLanguageObjectFromHandle    (SRRecognitionSystem     system,
  401.                                  SRLanguageObject *        languageObject,
  402.                                  Handle                 lObjHandle)                            THREEWORDINLINE(0x303C, 0x0417, 0xAA56);
  403.  
  404. EXTERN_API( OSErr )
  405. SRNewLanguageObjectFromDataFile    (SRRecognitionSystem     system,
  406.                                  SRLanguageObject *        languageObject,
  407.                                  short                     fRefNum)                            THREEWORDINLINE(0x303C, 0x0427, 0xAA56);
  408.  
  409. EXTERN_API( OSErr )
  410. SREmptyLanguageObject            (SRLanguageObject         languageObject)                        THREEWORDINLINE(0x303C, 0x0218, 0xAA56);
  411.  
  412. EXTERN_API( OSErr )
  413. SRChangeLanguageObject            (SRLanguageObject         languageObject,
  414.                                  const void *            text,
  415.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0619, 0xAA56);
  416.  
  417. EXTERN_API( OSErr )
  418. SRAddLanguageObject                (SRLanguageObject         base,
  419.                                  SRLanguageObject         addon)                                THREEWORDINLINE(0x303C, 0x041A, 0xAA56);
  420.  
  421. EXTERN_API( OSErr )
  422. SRAddText                        (SRLanguageObject         base,
  423.                                  const void *            text,
  424.                                  Size                     textLength,
  425.                                  long                     refCon)                                THREEWORDINLINE(0x303C, 0x081B, 0xAA56);
  426.  
  427. EXTERN_API( OSErr )
  428. SRRemoveLanguageObject            (SRLanguageObject         base,
  429.                                  SRLanguageObject         toRemove)                            THREEWORDINLINE(0x303C, 0x041C, 0xAA56);
  430.  
  431. /* Traversing SRRecognitionResults or SRLanguageObjects */
  432. EXTERN_API( OSErr )
  433. SRCountItems                    (SRSpeechObject         container,
  434.                                  long *                    count)                                THREEWORDINLINE(0x303C, 0x0405, 0xAA56);
  435.  
  436. EXTERN_API( OSErr )
  437. SRGetIndexedItem                (SRSpeechObject         container,
  438.                                  SRSpeechObject *        item,
  439.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0606, 0xAA56);
  440.  
  441. EXTERN_API( OSErr )
  442. SRSetIndexedItem                (SRSpeechObject         container,
  443.                                  SRSpeechObject         item,
  444.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0607, 0xAA56);
  445.  
  446. EXTERN_API( OSErr )
  447. SRRemoveIndexedItem                (SRSpeechObject         container,
  448.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0408, 0xAA56);
  449.  
  450. /* Utilizing the System Feedback Window */
  451. EXTERN_API( OSErr )
  452. SRDrawText                        (SRRecognizer             recognizer,
  453.                                  const void *            dispText,
  454.                                  Size                     dispLength)                            THREEWORDINLINE(0x303C, 0x0621, 0xAA56);
  455.  
  456. EXTERN_API( OSErr )
  457. SRDrawRecognizedText            (SRRecognizer             recognizer,
  458.                                  const void *            dispText,
  459.                                  Size                     dispLength)                            THREEWORDINLINE(0x303C, 0x0622, 0xAA56);
  460.  
  461. EXTERN_API( OSErr )
  462. SRSpeakText                        (SRRecognizer             recognizer,
  463.                                  const void *            speakText,
  464.                                  Size                     speakLength)                        THREEWORDINLINE(0x303C, 0x0620, 0xAA56);
  465.  
  466. EXTERN_API( OSErr )
  467. SRSpeakAndDrawText                (SRRecognizer             recognizer,
  468.                                  const void *            text,
  469.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x061F, 0xAA56);
  470.  
  471. EXTERN_API( OSErr )
  472. SRStopSpeech                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0223, 0xAA56);
  473.  
  474. EXTERN_API( Boolean )
  475. SRSpeechBusy                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0224, 0xAA56);
  476.  
  477. EXTERN_API( OSErr )
  478. SRProcessBegin                    (SRRecognizer             recognizer,
  479.                                  Boolean                 failed)                                THREEWORDINLINE(0x303C, 0x031D, 0xAA56);
  480.  
  481. EXTERN_API( OSErr )
  482. SRProcessEnd                    (SRRecognizer             recognizer,
  483.                                  Boolean                 failed)                                THREEWORDINLINE(0x303C, 0x031E, 0xAA56);
  484.  
  485.  
  486.  
  487.  
  488. #if PRAGMA_STRUCT_ALIGN
  489.     #pragma options align=reset
  490. #elif PRAGMA_STRUCT_PACKPUSH
  491.     #pragma pack(pop)
  492. #elif PRAGMA_STRUCT_PACK
  493.     #pragma pack()
  494. #endif
  495.  
  496. #ifdef PRAGMA_IMPORT_OFF
  497. #pragma import off
  498. #elif PRAGMA_IMPORT
  499. #pragma import reset
  500. #endif
  501.  
  502. #ifdef __cplusplus
  503. }
  504. #endif
  505.  
  506. #endif /* __SPEECHRECOGNITION__ */
  507.  
  508.